package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.Bank;
import com.acme.bankapp.domain.bank.CheckingAccount;
import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.domain.bank.Gender;
import com.acme.bankapp.domain.bank.SavingAccount;
import com.acme.bankapp.service.bank.BankService;

public class BankAplication {

	public static void main(String[] args) {
		
		Bank bank = new Bank();

		BankService.addClient(bank, new Client("Ivan", Gender.MALE,   new SavingAccount  (110)      ) );
		BankService.addClient(bank, new Client("Petr", Gender.MALE,   new CheckingAccount(120, 100) ) );
		BankService.addClient(bank, new Client("Anna", Gender.FEMALE, new SavingAccount  (130)      ) );
		BankService.addClient(bank, new Client("Ivan", Gender.FEMALE, new CheckingAccount(140, 50)  ) );
		BankService.addClient(bank, new Client("Ivan", Gender.MALE,   new SavingAccount  (110)      ) );
		

		for (Client client: bank.getClients() ) {
			BankService.modifyBank(bank, client, 120);
			System.out.println(
					client.getClientSalutation() + " balance: " + 
					client.getAccount().getBalance() + " available (with overdraft): " + 
					client.getAccount().maximumAmountToWithdraw() );
		}
	}
}
